<template>
  <div class="page-content">
    <div class="page-left">
      <dv-border-box-8 :color="[mainColorOpcity, mainColor]">
        <panel2 ref="panel2" :source="source"> </panel2>
      </dv-border-box-8>
    </div>
    <div class="page-right">
      <dv-border-box-8 :color="[mainColorOpcity, mainColor]">
        <panel4 ref="panel4" :source="source"></panel4>
      </dv-border-box-8>
    </div>
  </div>
</template>

<script>
import panel2 from './components/panel2.vue'
import panel4 from './components/panel4.vue'

export default {
  name: 'index',
  components: { panel2, panel4 },
  props: {
    source: String,
    mainColor: String,
    mainColorOpcity: String,
  },
  data() {
    return {
      key: new Date().toLocaleTimeString(),
    }
  },
  mounted() {
    window.onresize = () => {
      // 可视区域的高度
      const clientHeight = document.documentElement.clientHeight || document.body.clientHeight
      // screen是window的属性方法，window.screen可省略window，指的是窗口
      this.isFull = screen.height == clientHeight
      this.$refs.panel2.onResize()
      this.$refs.panel4.onResize()
    }
  },
  destroyed() {
    window.onresize = null
  },
  methods: {},
}
</script>

<style scoped lang="scss">
$bgColor: #060a22;
$mainColor: #68cee0;
$mainColorOpcity: rgba(104, 206, 224, 0.3);

.page-content {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .page-left {
    flex: 1 1 auto;
    width: 50vw;
    height: 100%;
    overflow: hidden;
  }
  .page-right {
    flex: 1 1 auto;
    width: 50vw;
    height: 100%;
    overflow: hidden;
  }
}
</style>
